package lyj.springcloud.controller;

import com.lyj.springcloud.entities.CommonResult;
import lombok.extern.slf4j.Slf4j;
import lyj.springcloud.feign.PaymentFeignService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
@RequestMapping("/order")
public class OpenFeignController {

    @Resource
    PaymentFeignService feignService;

    /**
     * 测试 feign调用 服务
     * @return
     */
    @GetMapping("/feign")
    public CommonResult toFeign() {
        return feignService.linkFeign();
    }

    /**
     * 测试 feign 负载均衡
     */

    @GetMapping("/loadbance")
    public CommonResult loadbance() {
        return feignService.myLb();
    }
}
